<?php
## include required files
/*******************************/
require_once '../../includefiles.php';
require_once '../../model/trade.php';
include_once("../../model/users.php");
require_once '../../model/state.php';
require_once '../../redirect.php';

## Create Objects
/*******************************/
$objTrade = new Model_TRADE();
$userObj = new Model_Users();
$stateObj = new Model_State();
/*******************************/
$allsubcats = $objTrade->getAllSubcats();

checkUserLogin();


if($_SESSION['user_type'] == '3')
{
	@header("location:".SITE_URL."/");
	exit;
}


if($_SESSION['cats']['list'])
{
	for($i=0;$i<count($allsubcats);$i++)
	{
		for($j=0;$j<count($allsubcats[$i]["data"]);$j++)
		{
			if(in_array($allsubcats[$i]["data"][$j]["id"],$_SESSION['cats']['ids']))
				$allsubcats[$i]["data"][$j]["selected"] = '1';
			else
				$allsubcats[$i]["data"][$j]["selected"]= 0;	
		}	
	}
}


$smarty->assign('subcats',$allsubcats);
$active = "myaccount";
$smarty->assign("active", $active);
$subactive ="myservicelocation";
$smarty->assign("subactive", $subactive);
$smarty->assign('mainmenu', '3');
$smarty->assign('serviceslist', '1');
$smarty->display(TEMPLATEDIR . '/modules/myaccount/serviceslist.tpl');
?>